* 01 JANUARY 2009
* REPLICATION FILE FOR "DEMOCRACY UNDER THE GUN: UNDERSTANDING POST-CONFLICT ECONOMIC RECOVERY"
* by Thomas Edward Flores and Irfan Nooruddin

set more off


set mem 500m
*TABLE 2:  9-DUMMY VARIABLE EQUATION
*COLUMN 1: RECOVERY

stset recover_time2, f(recover2==1) exit(exit_year2==1) id(testnewid_lag)

streg t1_auto_auto t1_auto_anoc t1_auto_demo t1_anoc_auto t1_anoc_anoc t1_anoc_demo t1_demo_auto t1_demo_anoc t1_demo_demo /* 
*/ prewar_lngdppc2 aidXtimecat1 aidXtimecat2 aidXtimecat3 issue_territory_lag cw_duration_lag cw_duration_sq /*
*/ damage victory_lag peace_agreement_lag recovery_num2 cim_ch_average /*
*/ if west==0&ctrycode~="GHA", noconstant dist(lnormal) nolog cluster(id)
test peace_agreement_lag = victory_lag

*COLUMN 2: RECURRENCE

stset recover_time2, f(recur2==1) exit(exit_year2==1) id(testnewid_lag)

streg t1_auto_auto t1_auto_anoc t1_auto_demo t1_anoc_auto t1_anoc_anoc t1_anoc_demo t1_demo_auto t1_demo_anoc t1_demo_demo /* 
*/ prewar_lngdppc2 aidXtimecat1 aidXtimecat2 aidXtimecat3 issue_territory_lag cw_duration_lag cw_duration_sq /*
*/ damage victory_lag peace_agreement_lag recovery_num2 cim_ch_average /*
*/ if west==0&ctrycode~="GHA", noconstant dist(lnormal) nolog cluster(id)
test peace_agreement_lag = victory_lag

*TABLE 2: RANK ORDERING OF TRANSITION TYPES
stset recover_time2, f(recover2==1) exit(exit_year2==1) id(testnewid_lag)

streg t1_auto_auto t1_auto_anoc t1_auto_demo t1_anoc_auto t1_anoc_anoc t1_anoc_demo t1_demo_auto t1_demo_anoc t1_demo_demo /* 
*/ prewar_lngdppc2 ln_oda_constant_new issue_territory_lag cw_duration_lag cw_duration_sq   /*
*/ damage victory_lag peace_agreement_lag recovery_num2 /*
*/ if west==0&ctrycode~="GHA", noconstant dist(lnormal) nolog cluster(id)

test  t1_demo_demo = t1_anoc_auto
test  t1_anoc_auto = t1_anoc_demo
test  t1_anoc_demo = t1_auto_auto
test  t1_auto_auto = t1_demo_auto
test  t1_demo_auto = t1_anoc_anoc
test  t1_anoc_anoc = t1_demo_anoc
test  t1_demo_anoc = t1_auto_demo
test  t1_auto_demo = t1_auto_anoc

stset recover_time2, f(recur2==1) exit(exit_year2==1) id(testnewid_lag)

streg t1_auto_auto t1_auto_anoc t1_auto_demo t1_anoc_auto t1_anoc_anoc t1_anoc_demo t1_demo_auto t1_demo_anoc t1_demo_demo /* 
*/ prewar_lngdppc2 ln_oda_constant_new issue_territory_lag cw_duration_lag cw_duration_sq   /*
*/ damage victory_lag peace_agreement_lag recovery_num2 /*
*/ if west==0&ctrycode~="GHA", noconstant dist(lnormal) nolog cluster(id)

test  t1_demo_demo = t1_anoc_auto
test  t1_anoc_auto = t1_anoc_demo
test  t1_anoc_demo = t1_auto_auto
test  t1_auto_auto = t1_demo_auto
test  t1_demo_auto = t1_anoc_anoc
test  t1_anoc_anoc = t1_demo_anoc
test  t1_demo_anoc = t1_auto_demo
test  t1_auto_demo = t1_auto_anoc

* TABLE 3: CREDIBLE COMMITMENTS AND INVESTMENTS
* FDI INFLOWS
gen wdi61_ch=d.wdi61
egen wdi61_ch_average = mean(wdi61_ch), by(testnewid_lag)
ttest wdi61_ch_average if exit_year2==1, by(t2_auto)
ttest wdi61_ch_average if exit_year2==1, by(t2_none)
ttest wdi61_ch_average if exit_year2==1, by(t2_demo)
ttest wdi61_ch_average if exit_year2==1, by(victory_lag)
ttest wdi61_ch_average if exit_year2==1, by(peace_agreement_lag)
ttest wdi61_ch_average if exit_year2==1, by(ceasefire_lag)
ttest wdi61_ch_average if exit_year2==1, by(political_ps)

* GROSS DOMESTIC SAVINGS
gen wdi84_ch=d.wdi84
egen wdi84_ch_average = mean(wdi84_ch), by(testnewid_lag)
ttest wdi84_ch_average if exit_year2==1, by(t2_auto)
ttest wdi84_ch_average if exit_year2==1, by(t2_none)
ttest wdi84_ch_average if exit_year2==1, by(t2_demo)
ttest wdi84_ch_average if exit_year2==1, by(victory_lag)
ttest wdi84_ch_average if exit_year2==1, by(peace_agreement_lag)
ttest wdi84_ch_average if exit_year2==1, by(ceasefire_lag)
ttest wdi84_ch_average if exit_year2==1, by(political_ps)

** TABLE 4: POLITICAL TRANSITION AND OTHER TYPES OF CREDIBLE COMMITMENT

* OUTRIGHT VICTORY
tab t1_auto_auto victory_lag if recover_time2==1
tab t1_auto_anoc victory_lag if recover_time2==1
tab t1_auto_demo victory_lag if recover_time2==1
tab t1_anoc_auto victory_lag if recover_time2==1
tab t1_anoc_anoc victory_lag if recover_time2==1
tab t1_anoc_demo victory_lag if recover_time2==1
tab t1_demo_auto victory_lag if recover_time2==1
tab t1_demo_anoc victory_lag if recover_time2==1
tab t1_demo_demo victory_lag if recover_time2==1

* NEGOTIATED SETTLEMENT
tab t1_auto_auto peace_agreement_lag if recover_time2==1
tab t1_auto_anoc peace_agreement_lag if recover_time2==1
tab t1_auto_demo peace_agreement_lag if recover_time2==1
tab t1_anoc_auto peace_agreement_lag if recover_time2==1
tab t1_anoc_anoc peace_agreement_lag if recover_time2==1
tab t1_anoc_demo peace_agreement_lag if recover_time2==1
tab t1_demo_auto peace_agreement_lag if recover_time2==1
tab t1_demo_anoc peace_agreement_lag if recover_time2==1
tab t1_demo_demo peace_agreement_lag if recover_time2==1

* POLITICAL POWER-SHARING AGREEMENT
tab t1_auto_auto political_ps if recover_time2==1
tab t1_auto_anoc political_ps if recover_time2==1
tab t1_auto_demo political_ps if recover_time2==1
tab t1_anoc_auto political_ps if recover_time2==1
tab t1_anoc_anoc political_ps if recover_time2==1
tab t1_anoc_demo political_ps if recover_time2==1
tab t1_demo_auto political_ps if recover_time2==1
tab t1_demo_anoc political_ps if recover_time2==1
tab t1_demo_demo political_ps if recover_time2==1


